package org.xlx.xlx_oa.attendance.api;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.xlx.xlx_oa.attendance.domain.dto.AttendanceApplyDto;
import org.xlx.xlx_oa.attendance.domain.vo.AttendanceApplyVo;
import org.xlx.xlx_oa.common.ResponseBean;
import org.xlx.xlx_oa.role_user.domain.dto.AdmProcessDto;
import org.xlx.xlx_oa.role_user.domain.vo.AuditVo;

import java.util.List;

@ApiImplicitParams(value = {
        @ApiImplicitParam(name = "x-request-id", value = "${clientTraceId}",
                paramType = "header", dataType = "String", dataTypeClass = String.class),
        @ApiImplicitParam(name = "Authorization", value = "${BearerToken}",
                paramType = "header", dataType = "String", dataTypeClass = String.class, required = false)
})
@ApiResponses(value = {
        @ApiResponse(code = 400, message = "Bad Request"),
        @ApiResponse(code = 401, message = "Authentication Error"),
        @ApiResponse(code = 403, message = "Authorization Error"),
        @ApiResponse(code = 500, message = "Internal Server Error"),
        @ApiResponse(code = 503, message = "Service Unavailable")
})
public interface AttendanceApplyApi {
    @PostMapping("/saveApply")
    ResponseBean saveAttendanceApply(@RequestBody AttendanceApplyVo attendanceApplyVo);

    @PostMapping("/audit")
    ResponseBean<Boolean> auditApply(@RequestBody AuditVo auditVo);

    @PostMapping("/beAuditList")
    ResponseBean<List<AttendanceApplyDto>> getBeAuditPage(@RequestBody AttendanceApplyVo applyVo);

    @PostMapping("/beAuditedCount")
    ResponseBean<Integer> getBeAuditedCount(@RequestBody AttendanceApplyVo applyVo);

    @PostMapping("/appliedList")
    ResponseBean<List<AttendanceApplyDto>> getAppliedPage(@RequestBody AttendanceApplyVo applyVo);

    @PostMapping("/appliedCount")
    ResponseBean<Integer> getAppliedCount(@RequestBody AttendanceApplyVo applyVo);

    @GetMapping("/detail/{applyId}")
    ResponseBean<List<AdmProcessDto>> getApplyDetail(@PathVariable(value = "applyId") Long applyId);
}
